﻿using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.Net.Mime;
using System.Security.Cryptography;
using System.Threading;
using Microsoft.SqlServer.Server;
using static System.Console;
using System.Text;
namespace presskey_game
{
    internal class Program
    {
        
        public static int total = 0;
        public static int random_number()
        {
            Random num = new Random();
            Thread.Sleep(10);
            int temp = num.Next(97, 123);
            return temp;
        }//随机生成ascii码
        public static void Main(string[] args)
        {
            WriteLine("按下0退出游戏");
            // string alpha = ((char) 65).ToString();
            for (int i = 0; ; i++)
            {
                int key=random_number();
                int key_big = key - 32;
                string keyy = ((char) key).ToString();//int转换成string
                string keyy_big = ((char) key_big).ToString();
                WriteLine(keyy);
                string inputt = ReadLine();
                if (inputt==keyy||inputt==keyy_big)
                {
                    WriteLine("correct");
                }
                else if (inputt=="0")
                {
                    break;
                }
                else
                {
                    WriteLine("wrong");
                    total++;
                }
                WriteLine("共输入错{0}次",total);
            }
        }
         }
    }